<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<h1>普通方式</h1>
<span th:text="${userName}"></span>
<h2>inline</h2>
<span>[[${userName}]]</span>


<script>
    var userId = [[${userId}]];
    var userName = "[[${userName}]]";
    console.log("用户编号:"+userId);
    alert("欢迎光临"+userName);


</script>
</body>
</html>